#pragma once

namespace gk
{
	#define GK_DATABLOCK(theType)	typedef cr::DataBlock<DataBlockSizes::theType> DataBlock; DataBlock m_dataBlock;

	namespace ClearType
	{
		enum Enum
		{
			ColourTarget	= 1,
			DepthTarget		= 2,
			StencilTarget	= 4,

			All				= 0xffffffff,
		};
	}

	namespace ContextType
	{
		enum Enum
		{
			Invalid = 0,

			Immediate,
			Deferred,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace BufferFormat
	{
		enum Enum
		{
			Invalid = 0,

			// Special formats
			VertexStream,
			Index16Stream,
			Index32Stream,
			ConstantBuffer,

			// Integer pixel data
			R8G8B8A8,
			R8G8B8,
			R5G6B5,

			// Floating point pixel data
			RGBA16F,
			RGBA32F,

			// Compressed pixel data
			DXT1,
			DXT2,
			DXT3,
			DXT4,
			DXT5,

			// Depth formats
			D24S8,
			D16,
			D32,

			// Invalid / 4 byte force
			Force32 = 0xffffffff,

			// Category markers
			SpecialFormatBegin = VertexStream,
			SpecialFormatEnd = ConstantBuffer+1,

			ColourFormatBegin = R8G8B8A8,
			ColourFormatEnd = RGBA32F+1,

			DepthFormatBegin = D24S8,
			DepthFormatEnd = D32+1
		};

		inline bool IsSpecialFormat(Enum e)
		{
			return e >= SpecialFormatBegin && e < SpecialFormatEnd;
		}

		inline bool IsColourFormat(Enum e)
		{
			return e >= ColourFormatBegin && e < ColourFormatEnd;
		}

		inline bool IsDepthFormat(Enum e)
		{
			return e >= DepthFormatBegin && e < DepthFormatEnd;
		}
	}

	namespace MultisampleType
	{
		enum Enum
		{
			Invalid, 

			None,
			X2,
			X4,

			Force32 = 0xffffffff,
		};
	}

	namespace SamplerIndex
	{
		enum Enum
		{
			Sampler0,
			Sampler1,
			Sampler2,
			Sampler3,
			Sampler4,
			Sampler5,
			Sampler6,
			Sampler7,
			Sampler8,

			NumberOf,

			Invalid,

			First = 0,

			Force32 = 0xffffffff,
		};
	}

	namespace SamplerState
	{
		enum Enum
		{
			AddressModeU,
			AddressModeV,
			AddressModeW,

			FilterMin,
			FilterMag,
			FilterMip,
			FilterMaxAnisos,
			FilterMipBias,

			// Count
			NumberOf,

			Invalid,

			First = 0,

			// 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace SamplerStateValue
	{
		enum Enum
		{
			AddressModeWrap,
			AddressModeClamp,

			FilterPoint,
			FilterLinear,
			FilterAnisotropic,

			NumberOf,

			Invalid, 

			First = 0,

			// 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace RenderState
	{
		enum Enum
		{
			Invalid = 0, 

			AlphaTest,
			AlphaTestThreshold,

			DepthTest,
			DepthWrite,

			CullFace,

			// Count
			NumberOf,

			// Start marker
			First = Invalid+1,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace RenderStateValue
	{
		enum Enum
		{
			Invalid = 0,

			// Depth buffering
			DepthTestEnabled,
			DepthTestDisabled,

			DepthWriteEnabled,
			DepthWriteDisabled,

			// Alpha test
			AlphaTestEnabled,
			AlphaTestDisabled,

			// Face culling
			CullFaceNone,
			CullFaceBack,
			CullFaceFront,

			// Comparison
			LessThan,
			LessThanOrEqual,
			Equal,
			GreaterThanOrEqual,
			GreaterThan,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace GpuProgramFormat
	{
		enum Enum
		{
			Invalid,

			SourceCode,
			ObjectCode,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace PrimitiveType
	{
		enum Enum
		{
			Invalid,

			TriangleList,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace GpuProgramParameterType
	{
		enum Enum
		{
			Invalid,

			Float,
			Vector,
			Matrix,
			Int,
			Bool,
			Texture,
			Sampler,

			// Invalid / 4 byte force
			Force32 = 0xffffffff
		};
	}

	namespace ConstantBufferTarget
	{
		enum Enum
		{
			Invalid,

			// Sampler tables
			PixelSamplers,
			VertexSamplers,

			// Shader tables
			VertexShader,
			PixelShader,

			Force32 = 0xffffffff,
		};
	}
}